<?php if (!$model->hasRated(Yii::app()->user->id)): ?>
		
	<div class="rate clearfix">
		<div class="up float-left">
			<?php echo CHtml::ajaxLink(CHtml::image(Yii::app()->baseUrl.'/images/icon-thumb-up.png',Yii::t('frontend','Rate Up')),
					array('/comment/rate','id'=>$model->id),array(
				'type'=>'post',
				'data'=>'type='.Rate::TYPE_UP,
				'success'=>"js:function(data) {
					jQuery('#rateContainer_{$model->id}').html(data);
					jQuery('.twipsify').bootstraptwipsy();
				}",
			),array('class'=>'twipsify','title'=>Yii::t('frontend','Rate Up'))); ?>
			<strong><?php echo CHtml::encode($model->ups); ?></strong>
		</div>
		<div class="down float-right">
			<?php echo CHtml::ajaxLink(CHtml::image(Yii::app()->baseUrl.'/images/icon-thumb-down.png',Yii::t('frontend','Rate Down')),
					array('/comment/rate','id'=>$model->id),array(
				'type'=>'post',
				'data'=>'type='.Rate::TYPE_DOWN,
				'success'=>"js:function(data) {
					jQuery('#rateContainer_{$model->id}').html(data);
					jQuery('.twipsify').bootstraptwipsy();
				}",
			),array('class'=>'twipsify','title'=>Yii::t('frontend','Rate Down'))); ?>
			<strong><?php echo CHtml::encode($model->downs); ?></strong>
		</div>
	</div>

<?php else: ?>

	<div class="rated">
		<div class="up float-left">
			<?php echo CHtml::image(Yii::app()->baseUrl.'/images/icon-thumb-up.png'); ?>
			<strong><?php echo CHtml::encode($model->ups); ?></strong>
		</div>
		<div class="down float-right">
			<?php echo CHtml::image(Yii::app()->baseUrl.'/images/icon-thumb-down.png'); ?>
			<strong><?php echo CHtml::encode($model->downs); ?></strong>
		</div>
	</div>

<?php endif; ?>